perm filename LECT1.TEX[ARK,TEX] blob
sn#766827 filedate 1984-08-18 generic text, type C, neo UTF8
COMMENT ā VALID 00007 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 % copyright 1984 by Arthur Keller ... All rights reserved
C00004 00003 \section{Text to Typeset Copy}
C00010 00004 \section{The Character Set (or Special Characters)}
C00018 00005 \section{The Process of Typesetting}
C00021 00006 \section{Dimensions}
C00028 00007 \section*{Assignment}
C00029 ENDMK
Cā;
% copyright 1984 by Arthur Keller ... All rights reserved
\chapter{\TeX\ Overview}
%Mon, August 20
%9-10am
%TeX Overview
%>Text to typeset copy
%>Files: .TeX, .DVI, .LOG
%>Character set
%>Dimensions
\TeX\ is a system developed by Donald E. Knuth of Stanford University
that can produce beautifully typeset documents.
Typesetting is rather different from ordinary typing.
For example, there are different styles of type you can use, such as
{\bf bold face} and {\it italics}.
Since we are going to use \TeX\ to produce professional looking documents,
we should learn how to mark up the documents correctly with professional
proofreader/\hskip0pt copyeditor symbols. These are listed on the following
page.
\begin{figure}[p]
\vskip6truein
\caption{Put copyeditor symbols here}
\end{figure}
\section{Text to Typeset Copy}
To produce output with \TeX, you first must create an input file to be
processed by \TeX.
This input file will consist of commands to \TeX\ plus the copy or text
that you want to have typeset.
The input file is created with a conventional text editor such as the
display editor {\tt BEMACS}.
Since the convention when using the TOPS-20 operating system is that the
file name extension (see the next chapter)
indicates the type of file that it is, an input file
might be called {\tt document.tex}, where the extension {\tt .tex} indicates
that this is a \TeX\ input file.
Once this file has been completed (which may involve several sessions of
editing and re-editing with the editor), you are ready to run \TeX.
In order to create a typeset document, \TeX\ will process the commands in
the input file and produce an output file known as {\tt document.dvi}.
The file extension {\tt .dvi} stands for ``DeVice Independent,'' since it is
capable of being printed on a variety of printing devices.
\TeX\ also produces another file called {\tt document.lst} known as a ``log
file'' (here {\tt .lst} stands for ``list''), which will contain all the
messages which \TeX\ sent to your terminal while it was processing your
input, plus some additional information that is sometimes useful for fixing
problems.
In processing your input, \TeX\ puts the text or copy it contains in the
typeface, style, weight, and size you have selected.
A typeface is something like ordinary type (known as ``roman'' type), {\it
italic type}, {\sl slanted type}, or {\tt typewriter type}.
A type weight is something like ordinary weight,
{\bf bold face}, which is heavier in appearance.
Some typefaces also come in {\sl extrabold}, which is even darker
than bold, and {\sl medium}, which is between ordinary and bold.
The fonts we will be using, however, do not make these additional distinctions.
A type style is something like {\sf sans serif}; a serif is a little
cross-stroke on the end of each stroke of a character {\sf which this type
style doesn't have}.
In addition, typefaces come in various sizes.
This size is 10 point type.
{\egtrm This is eight point type.}
Of course, you may use only the typefaces that exist already on the
output device you are using.
Some typefaces exist on some output devices and not others, but all of the
typefaces we will talk about should exist on the output device you will
be using for this course.
To print your output, the {\tt .dvi} file must undergo further processing by the
``device driver'' for your particular output device.
We will use an Imagen printer for this course; it is also known by the
name Canon, since they make the printing engine that is part of the Imagen
printer.
The device driver creates another file (in our case, {\tt document.imp})
which is capable of actually being printed by the Imagen printer.
The {\tt .imp} file must then be send to the printer, and output results.
Thanks to the wonders of modern technology, everything described in this
paragraph is accomplished more or less automagically once you run \TeX,
but it is useful for you to understand what is going on behind the scenes.
\section{The Character Set (or Special Characters)}
%
%See Ch.7 of TexBook
\TeX\ needs special characters in the input ({\tt .tex}) file to be able
to distinguish commands from the text you are typesetting.
Some of the characters which appear on your keyboard and have special
meanings to \TeX\ are as shown below.
The explanations of {\sl what they do} may not make a lot of sense to you
right now; what is important is that you understand that they have
special meanings to \TeX.
\des{\bs} This is the ``backslash,'' not to be confused with the ordinary
slash `/'.
The backslash is known as the ``escape character'' (not to be confused
with the Escape key on your terminal); it signals the start of a control
sequence (command) to \TeX.
\des{\lb\ and \rb} These curly braces are used as delimiters or
grouping brackets by \TeX. They mark off a region of text in your
file which is to be affected by some command.
\des{{\tt\$}} The dollar sign is used to begin and end ``math mode''
in \TeX. To get an ordinary dollar sign printed as part of your
output, you must type \cmd{\$}.
\des{{\tt\&}} The ampersand is used as an alignment marker in tables.
To get an ordinary ampersand in your output, you must type \cmd{\&}.
\des{{\tt \#}} The number or pound sign is used for passing
parameters to \TeX\ macros. To get an ordinary `\#' in your document, type
\cmd{\#}.
\des{{\tt\%}} The percent sign is used to begin a comment in your input
file.
\TeX\ will ignore everything from a `{\tt \%}' to the end of the line.
This is useful for documenting your input, or putting reminders to
yourself in you file.
To get an ordinary `\%' in your document, type \cmd{\%}.
\des{\caret} The caret (or up-arrow) is used in math mode to indicate
superscripting.
It is possible to get a circumflex accent over a character by typing
\cmd{\caret}.
\des{\_} The underscore symbol is used in math mode to indicate
subscripting.
It is possible to get an underscore in your document by typing \cmd{\_};
this is useful for {\it compound\_identifiers} in computer programs.
Note that you never will want to underline any text when using \TeX:
underlining (of the title of a book, say) is used on a typewriter only
because italics are not available, but in \TeX, of course, they are.
(In fact, underlining by convention means ``put in italics'' to a
typesetter.)
\des{\Tilde} The tilde accent is used in \TeX\ to indicate a space which
can not serve as a line break.
To get a tilde accent over a character, you type \cmd{\Tilde}.
Aside from these special characters, there are a number of things to
know about preparing input for \TeX.
In general, \TeX\ does not care when you type \ret\ in your input file.
(We use the symbol \ret\ to indicate a carriage return key; that is,
what you get when you press the ``return key.''$\,$)
\TeX will normally ignore line breaks in the input and produce paragraphs
with an even right margin (that is, text which is ``justified'' and
``filled'').
However, two \ret s in a row (that is, a blank line in your input file) tell
\TeX\ to begin a new paragraph.
It is also possible to tell \TeX\ to obey the line breaks in your input
file (with the command \cmd{obeylines}), which is useful when typing an
address.
Similarly, \TeX\ is not very particular about where you hit the space bar.
\TeX\ will treat any number of consecutive spaces as though they were a
single space, so whether you type one or two spaces at the end of a
sentence makes no difference.
(Spacing is a little tricky when you are dealing with control sequences;
there will be more about this point later.)
\TeX\ does follow the convention that extra space will be inserted after
certain punctuation marks: a comma has some extra space after it, a
semi-colon has slightly more, and a period even more.
Interestingly enough, this style began when typesetters were paid by the
length of columns of type that they set; by adding extra spaces, they made
the resulting output slightly longer and their pay slightly higher.
You can turn off this feature in your output by specifying
\cmd{frenchspacing}.
Although \TeX\ is not very picky about spacing, it is picky about case;
that is, upper-case (capitals) and lower-case (small letters) versions of
the same letter are different to \TeX, particularly inside control
sequences.
Thus, typing \cmd{Macroname} when you should have typed \cmd{macroname}
will result in an error message regarding an undefined control sequence.
Finally, rather than using the ``double quotes'' ({\tt\char'42}) key on
your terminal to begin and end quotations, you will use two left quotes
{\tt ``} to open quotations, and two apostrophes {\tt ''} to end them.
\section{The Process of Typesetting}
You {\sl could} prepare a document by creating the whole input file first,
and then running \TeX\ on it all at once.
However, this is not recommended:
it turns out to be much easier if you break your document up into pieces,
and run \TeX\ on it a little at a time.
The length of time it takes to process a long document all at once will
generally be greater than the sum of the times it takes to process it in
pieces.
The recommended technique is one borrowed from conventional typesetters
(or ``compositors,'' as they were sometimes known), who used to break text
they were setting into arbitrary pieces of a page or two which were called
``galleys'' (for the galley trays in which they type was put when set).
You can work on this chunk of text until you are satisfied with the
output, then append your input to a ``chapter'' file which has all the
previous input with which you're satisfied.
When you are done, you can then run \TeX\ on the whole ``chapter''.
There is no need to worry about whether your chunks of text (galleys) will
correspond to complete pages in the final output, since \TeX\ will do the
breaking into pages automatically.
Another point to note is that you should never have EMACS in ``auto fill
mode'' while preparing \TeX\ input.
In auto fill mode, EMACS will rearrange your text in order to ``fill''
each paragraph.
Since everything on a line of your input file following a `{\tt \%}' is
intended to be a comment, if EMACS moves your input around, things which
were intended as comments can end up in the text and vice versa.
A convenient technique is to begin each sentence of the document on a new
line of the input file.
This has the additional advantage of making it easy to rearrange
sentences.
\section{Dimensions}
\TeX\ has a number of ways in which dimensions can be specified.
Inches (abbreviated {\tt in}) and the metric units centimeters ({\tt cm})
and millimeters ({\tt mm}) are the ordinary measures with which we are
familiar.
However, \TeX\ uses some specialized typesetting units which may not be so
familiar; there are even some {\sl very} specialized units unique to \TeX.
In the Anglo-American typesetting world, the most common units of measure
are picas (abbreviated {\tt pc} in \TeX, although the usual abbreviation
is {\tt pi}) and points ({\tt pt}).
The printer's point is approximately $1/72$ of an inch; in fact, \TeX\
uses the convention that 72.27 points equal one inch.
(This \TeX\ point is slightly larger, by something like one part in a
million, than the printer's point used outside of \TeX.)
\TeX\ also allows you to express dimensions in the so-called ``big points''
({\tt bp}) used by some printers; however, this is not considered good
practice and its use is strongly discouraged.
Sizes of type are usually measured in points, as in ``10 point type'' for
type which is 10 points high.
The height refers to the distance from the top of the ``ascenders'' of
tall characters (like the {\tt d} or {\tt h}) to the bottom of the
``descenders'' of characters which go below the ``baseline'' (the line on
which the characters sit) like the {\tt g} or {\tt y}.
Points are used to measure not only the height of the type face, but also
the ``interline spacing,'' which is the amount of white space between
consecutive lines of type.
For example, 10 point type is usually printed with two points of interline
spacing (or ``leading,'' as it is sometimes called, from the days when the
space was created by inserting slugs of lead between the lines of type).
This is often referred to as ``10 on 12,'' and written $10 / 12$.
{\baselineskip=20pt
In \TeX, the distance between lines of type is controlled by the command
\cmd{baselineskip}, which sets the total distance between the baselines of
consecutive lines of type.
Thus, to get ``10 on 12'', we specify \cmd{baselineskip=12pt}, since 12
points between lines allows for 2 points of space plus the height of the
typeface itself.
For double-spaced output, we could use twice as large a \cmd{baselineskip}
(or 24pt), but that tends to be too airy.
We recommend that you use \cmd{baselineskip=20pt} for double-spaced output
instead.
This paragraph was set that way.
(For very subtle reasons we will learn later, make sure you end your
paragraph before changing the \cmd{baselineskip} back, as the
\cmd{baselineskip} seting affects whole paragraphs.)
Of course, if the typeface were a different size (such as 11pt), you would
need a different value for \cmd{baselineskip} (13pt) to get the same
amount of leading (2pt).
There is also a command known as \cmd{lineskip} which sets the minimum
amount of interline spacing in a document.
\par}
The pica is equal to 12 points.
This fact turns out to be useful since, when dealing with normal $10 / 12$
copy, each line and its associated spacing take up one pica.
Thus, twenty lines of ordinary text (without mathematics) will occupy 20
picas.
For this reason, picas are frequently used in typography to measure the
dimensions of the printed page.
The unit of measure peculiar to \TeX\ is the ``scaled point'' (abbreviated
{\tt sp}), which equals $1 / 65536$ of a point.
(Computer experts like dealing in powers of two, and 65536 happens to
equal $2ā{16}$.)
\TeX\ performs all of its internal calculations in terms of scaled points.
Dimensions need not be expressed in terms of integers; a dimension such as
{\tt 1.2pc} is perfectly legal.
(As a matter of fact, \TeX\ also accepts dimensions in the European style,
{\tt 1,2pc}, with a comma instead of a period.)
Dimensions also can take a minus sign (or a plus sign, which is somewhat
redundant.)
\section*{Assignment}
Reading for this lecture: The \TeX book Chapters~1--4, 7 (pp.~37--38),
and 10 (p.~57 only).